From 83eac3f33ac1234163472946c00341c81b72665f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 22 Jul 2020 16:31:44 +0100 Subject: [PATCH] a11y: Restart the accessibility test suite --- testsuite/a11y/meson.build | 69 ++++++++++++++++++++++++++++++++++++++ testsuite/meson.build | 1 + 2 files changed, 70 insertions(+) create mode 100644 testsuite/a11y/meson.build diff --git a/testsuite/a11y/meson.build b/testsuite/a11y/meson.build new file mode 100644 index 0000000000..ec50ba4273 --- /dev/null +++ b/testsuite/a11y/meson.build @@ -0,0 +1,69 @@ +testexecdir = join_paths(installed_test_bindir, 'gtk') +testdatadir = join_paths(installed_test_datadir, 'gtk') + +# Available keys for each test: +# +# - 'name': the test name; used for the test and to determine the base +# source file for the test (MANDATORY) +# - 'sources': (array): additional sources needed by the test +# - 'c_args': (array): additional compiler arguments +# - 'link_args': (array): additional linker arguments +# - 'suites': (array): additional test suites +tests = [ +] + + +# Tests that are expected to fail +xfail = [ +] + +is_debug = get_option('buildtype').startswith('debug') + +test_cargs = [] + +foreach flag: common_cflags + if flag not in ['-Werror=missing-prototypes', '-Werror=missing-declarations', '-fvisibility=hidden'] + test_cargs += flag + endif +endforeach + +test_env = environment() +test_env.set('GTK_TEST_ACCESSIBLE', '1') +test_env.set('GSK_RENDERER', 'cairo') +test_env.set('G_TEST_SRCDIR', meson.current_source_dir()) +test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) +test_env.set('GIO_USE_VFS', 'local') +test_env.set('GSETTINGS_BACKEND', 'memory') +test_env.set('G_ENABLE_DIAGNOSTIC', '0') + +foreach t : tests + test_name = t.get('name') + test_srcs = ['@0@.c'.format(test_name)] + t.get('sources', []) + test_extra_cargs = t.get('c_args', []) + test_extra_ldflags = t.get('link_args', []) + test_extra_suites = t.get('suites', []) + test_timeout = 60 + + test_exe = executable(test_name, test_srcs, + c_args: test_cargs + test_extra_cargs, + link_args: test_extra_ldflags, + dependencies: libgtk_dep, + install: get_option('install-tests'), + install_dir: testexecdir, + ) + + expect_fail = xfail.contains(test_name) + + if test_extra_suites.contains('slow') + test_timeout = 90 + endif + + test(test_name, test_exe, + args: [ '--tap', '-k' ], + protocol: 'tap', + timeout: test_timeout, + env: test_env, + suite: ['a11y'] + test_extra_suites, + should_fail: expect_fail, + ) +endforeach diff --git a/testsuite/meson.build b/testsuite/meson.build index 64961f5dc7..c8677d40f8 100644 --- a/testsuite/meson.build +++ b/testsuite/meson.build @@ -42,5 +42,6 @@ subdir('gdk') subdir('gsk') subdir('gtk') subdir('css') +subdir('a11y') subdir('tools') subdir('reftests') -- 2.30.2